//
//  Zone.m
//  作业7
//
//  Created by dllo on 16/7/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Zone.h"

@implementation Zone
- (instancetype)initWithName:(NSString *)name {
    
    return [self initWithName:name mNumber:nil];
}
- (void)dealloc
{
    [_name release];
    [_mNumber release];
    [super dealloc];
}
- (NSString *)description {
    return [NSString stringWithFormat:@"%@ %@",_name,_mNumber];
}
- (instancetype)initWithName:(NSString *)name
                     mNumber:(NSString *)mNumber {
    if (self = [super init]) {
        _name = [name copy];
        _mNumber = [mNumber copy];
    }
    return self;
}
- (instancetype)initWitnTempCity:(TempCity *)tempCity {
    return [self initWithName:tempCity.name mNumber:tempCity.number];
}
+ (instancetype)zoneWithName:(NSString *)name {
    return [[[Zone alloc] initWithName:name]autorelease];
}
+ (instancetype)zoneWithName:(NSString *)name
                     mNumber:(NSString *)mNumber {
    return [[[Zone alloc] initWithName:name mNumber:mNumber]autorelease];
}
+ (instancetype)zoneWitnTempCity:(TempCity *)tempCity {
    return [[Zone alloc]initWitnTempCity:tempCity];
}
@end
